96a821af00dc602731116e9409142c1388f4bcf1,wdl/WdlParser.java,WdlParser,parse_for_loop,#,868

Before Change


    ParseTree tree = new ParseTree( new NonTerminal(49, "for_loop"));
    tree.setList(null);
    if (current == null) {
      StackTraceElement[] stack = Thread.currentThread().getStackTrace();
      throw new SyntaxError(this.syntaxErrorFormatter.unexpected_eof(stack[1].getMethodName(), null));
    }
    if (rule == 14) {
      LinkedHashMap<String, Integer> parameters = new LinkedHashMap<String, Integer>();
      parameters.put("body", 7);
      parameters.put("item", 2);
      parameters.put("collection", 4);
      tree.setAstTransformation(new AstTransformNodeCreator("ForLoop", parameters));
      next = this.tokens.expect(TerminalId.TERMINAL_FOR.id(), this.syntaxErrorFormatter);
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_LPAREN.id(), this.syntaxErrorFormatter);
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_IDENTIFIER.id(), this.syntaxErrorFormatter);
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_IN.id(), this.syntaxErrorFormatter);
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_IDENTIFIER.id(), this.syntaxErrorFormatter);
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_RPAREN.id(), this.syntaxErrorFormatter);
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_LBRACE.id(), this.syntaxErrorFormatter);
      tree.add(next);
      subtree = this.parse__gen2();
      tree.add( subtree);
      next = this.tokens.expect(TerminalId.TERMINAL_RBRACE.id(), this.syntaxErrorFormatter);
      tree.add(next);
      return tree;
    }
    throw new SyntaxError(this.syntaxErrorFormatter.unexpected_symbol("for_loop", current, new ArrayList<Integer>()));
  }
  private ParseTree parse__gen10() throws SyntaxError {
    Terminal current = this.tokens.current();

After Change


    ParseTree tree = new ParseTree( new NonTerminal(35, "for_loop"));
    tree.setList(null);
    if (current == null) {
      throw new SyntaxError(this.syntaxErrorFormatter.unexpected_eof(
        "for_loop",
        Arrays.asList(this.first.get("for_loop")),
        this.nonterminal_rules.get("for_loop")
      ));
    }
    if (rule == 37) {
      LinkedHashMap<String, Integer> parameters = new LinkedHashMap<String, Integer>();
      parameters.put("body", 7);
      parameters.put("item", 2);
      parameters.put("collection", 4);
      tree.setAstTransformation(new AstTransformNodeCreator("ForLoop", parameters));
      next = this.tokens.expect(TerminalId.TERMINAL_FOR, "for_loop", this.rules.get(37));
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_LPAREN, "for_loop", this.rules.get(37));
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_IDENTIFIER, "for_loop", this.rules.get(37));
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_IN, "for_loop", this.rules.get(37));
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_IDENTIFIER, "for_loop", this.rules.get(37));
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_RPAREN, "for_loop", this.rules.get(37));
      tree.add(next);
      next = this.tokens.expect(TerminalId.TERMINAL_LBRACE, "for_loop", this.rules.get(37));
      tree.add(next);
      subtree = this.parse__gen2();
      tree.add( subtree);
      next = this.tokens.expect(TerminalId.TERMINAL_RBRACE, "for_loop", this.rules.get(37));
      tree.add(next);
      return tree;
    }
    List<TerminalIdentifier> terminals = Arrays.asList(this.first.get("for_loop"));
    throw new SyntaxError(this.syntaxErrorFormatter.unexpected_symbol(
      "for_loop",
      current, 
      Arrays.asList(this.first.get("for_loop")),
      this.rules.get(37)
    ));
  }
  private ParseTree parse_variable() throws SyntaxError {
    Terminal current = this.tokens.current();